use "/Users/filepathgoeshere/Boston_JLC_replication_apr2019.dta"

***USE THE FOLLOWING COMMANDS TO CONSTRUCT THE COMPLEXITY VARIABLE
*egen z_insight = std(insight)
*egen z_cause = std(cause)
*egen z_discrep = std(discrep)
*egen z_tentat = std(tentat)
*egen z_certain = std(certain)
*egen z_differ = std(differ)
*egen z_negate = std(negate)
*gen complexity= z_insight + z_cause + z_discrep + z_tentat + z_certain + z_differ + z_negate

***MAIN OLS REGRESSION: COLUMN 1 OF TABLE 2
reg complexity SEdist neg_treatment negative_SEdist
***FIGURE 2 COMMANDS MUST BE RUN AFTER REGRESSION ABOVE
*predict divhat
*predict stdpred, stdp
*gen lowerpred = divhat - 1.96 * stdpred
*gen upperpred = divhat + 1.96 * stdpred
*rename divhat divhat_ols_small
*rename stdpred stdpred_ols_small
*rename lowerpred lowerpred_ols_small
*rename upperpred upperpred_ols_small
graph twoway  (lfit divhat_ols_small SEdist if neg_treatment==1) (lfit lowerpred_ols_small SEdist if neg_treatment==1) (lfit upperpred_ols_small SEdist if neg_treatment==1) (lfit divhat_ols_small SEdist if neg_treatment==0) (lfit lowerpred_ols_small SEdist if neg_treatment==0) (lfit upperpred_ols_small SEdist if neg_treatment==0) (scatter point_six SEdist, msymbol(none) mlabel(symbol) mlabposition(0))

***FIGURE 1 REGRESSION 1
reg complexity SEdist if neg_treatment==1
***COMMANDS TO MAKE FIGURE 1A
*predict divhat
*predict stdpred, stdp
*gen lowerpred = divhat - 1.96 * stdpred
*gen upperpred = divhat + 1.96 * stdpred
*rename divhat divhat_ols_bivar_neg
*rename stdpred stdpred_ols_bivar_neg
*rename upperpred upperpred_ols_bivar_neg
*rename lowerpred lowerpred_ols_bivar_neg
graph twoway  (lfit divhat_ols_bivar_neg SEdist) (lfit lowerpred_ols_bivar_neg SEdist) (lfit upperpred_ols_bivar_neg SEdist) (scatter point_six SEdist if neg_treatment==1, msymbol(none) mlabel(symbol) mlabposition(0))


***FIGURE 1 REGRESSION 2
reg complexity SEdist if neg_treatment==0
***COMMANDS TO MAKE FIGURE 2A
*predict divhat
*predict stdpred, stdp
*gen lowerpred = divhat - 1.96 * stdpred
*gen upperpred = divhat + 1.96 * stdpred
*rename divhat divhat_ols_bivar_pos
*rename stdpred stdpred_ols_bivar_pos
*rename upperpred upperpred_ols_bivar_pos
*rename lowerpred lowerpred_ols_bivar_pos
graph twoway  (lfit divhat_ols_bivar_pos SEdist) (lfit lowerpred_ols_bivar_pos SEdist) (lfit upperpred_ols_bivar_pos SEdist) (scatter point_six SEdist if neg_treatment==0, msymbol(none) mlabel(symbol) mlabposition(0))


***COLUMNS 2, 3, & 4 OF TABLE 2
xtmixed complexity SEdist neg_treatment negative_SEdist, || us:

reg complexity SEdist neg_treatment negative_SEdist PEdist PSdist negative_PSdist negative_PEdist

xtmixed complexity SEdist neg_treatment negative_SEdist PEdist PSdist negative_PSdist negative_PEdist, || us:

